﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SchemeBalance.aspx.cs"
    Inherits="sWarranty.WEB.SchemeBalance" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="../UC/Header.ascx" TagName="Header" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../CSS/table.css" />
    <link rel="stylesheet" type="text/css" href="../CSS/Menu.css" />
    <link href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" rel="stylesheet"
        type="text/css" />
    <script src="../JS/jquery-1.8.2.js" type="text/javascript"></script>
    <script src="../JS/Menu.js" type="text/javascript"></script>
    <script src="../JS/jquery-ui.js" type="text/javascript"></script>
    <script src="../JS/notify.js" type="text/javascript"></script>
    <link href="../CSS/notify.css" rel="stylesheet" type="text/css" />
    <link href="../JS/chosen-master/chosen/chosen.css" rel="stylesheet" type="text/css" />
    <script src="../JS/chosen-master/chosen/chosen.jquery.js" type="text/javascript"></script>
    <script src="../JS/jquery.stickytableheaders.js" type="text/javascript"></script>
    <script>
        $(document).ready(function () {
            $("table").stickyTableHeaders();
            SetLogger();


            $('#dropbillShop').change(function () {
                var v = $('#dropbillShop').val();
                if (v == 'bill') {
                    $('#txtBill').show();
                    $('#txtShopName').hide();
                }
                else {
                    $('#txtBill').hide();
                    $('#txtShopName').show();
                }
            });
        });

        function reSelect() {
            //re-show textbox when postback
            var v = $('#dropbillShop').val();
            if (v == 'bill') {
                $('#txtBill').show();
                $('#txtShopName').hide();
            }
            else {
                $('#txtBill').hide();
                $('#txtShopName').show();
            }

        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ksdjfl" runat="server">
    </asp:ScriptManager>
    <uc1:Header ID="Header1" runat="server" />
    <div class="Mid">
        <div class="Mid1">
            <div id="DataContent">
                <%-- <div>
                    Nội dung bên trái
                </div>--%>
                <div>
                    <div id="divCreate" style="width: 100%">
                        <div class="TitleTab">
                            <ul>
                                <li><a href="SchemeBalance.aspx" class="TitleTab_act">Incentive Balance</a> </li>
                                <li><a href="IncentiveClosed.aspx">Closed Incentive</a></li>
                            </ul>
                        </div>
                        <!-- DataGrid Start -->
                        <div class="Mid2">
                            <div class="Search2">
                                <table id="newspaper-b">
                                    <tbody>
                                        <tr>
                                            <td class="BackGround-gray">
                                                Period:
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="dropMonth" runat="server" CssClass="chzn-select" Width="80px"
                                                    data-placeholder="From">
                                                    <asp:ListItem Value="01" Text="JAN"></asp:ListItem>
                                                    <asp:ListItem Value="02" Text="FEB"></asp:ListItem>
                                                    <asp:ListItem Value="03" Text="MAR"></asp:ListItem>
                                                    <asp:ListItem Value="04" Text="APR"></asp:ListItem>
                                                    <asp:ListItem Value="05" Text="MAY"></asp:ListItem>
                                                    <asp:ListItem Value="06" Text="JUN"></asp:ListItem>
                                                    <asp:ListItem Value="07" Text="JUL"></asp:ListItem>
                                                    <asp:ListItem Value="08" Text="AUG"></asp:ListItem>
                                                    <asp:ListItem Value="09" Text="SEP"></asp:ListItem>
                                                    <asp:ListItem Value="10" Text="OCT"></asp:ListItem>
                                                    <asp:ListItem Value="11" Text="NOV"></asp:ListItem>
                                                    <asp:ListItem Value="12" Text="DEC"></asp:ListItem>
                                                </asp:DropDownList>
                                                &nbsp;
                                                <asp:DropDownList ID="dropMonth2" runat="server" CssClass="chzn-select" Width="80px"
                                                    data-placeholder="To">
                                                    <asp:ListItem Value="01" Text="JAN"></asp:ListItem>
                                                    <asp:ListItem Value="02" Text="FEB"></asp:ListItem>
                                                    <asp:ListItem Value="03" Text="MAR"></asp:ListItem>
                                                    <asp:ListItem Value="04" Text="APR"></asp:ListItem>
                                                    <asp:ListItem Value="05" Text="MAY"></asp:ListItem>
                                                    <asp:ListItem Value="06" Text="JUN"></asp:ListItem>
                                                    <asp:ListItem Value="07" Text="JUL"></asp:ListItem>
                                                    <asp:ListItem Value="08" Text="AUG"></asp:ListItem>
                                                    <asp:ListItem Value="09" Text="SEP"></asp:ListItem>
                                                    <asp:ListItem Value="10" Text="OCT"></asp:ListItem>
                                                    <asp:ListItem Value="11" Text="NOV"></asp:ListItem>
                                                    <asp:ListItem Value="12" Text="DEC"></asp:ListItem>
                                                </asp:DropDownList>
                                                <asp:DropDownList ID="dropYear" runat="server" CssClass="chzn-select" Width="80px"
                                                    data-placeholder="..Year..">
                                                    <asp:ListItem Value="2012" Text="2012"></asp:ListItem>
                                                    <asp:ListItem Value="2013" Text="2013"></asp:ListItem>
                                                    <asp:ListItem Value="2014" Text="2014"></asp:ListItem>
                                                    <asp:ListItem Value="2015" Text="2015"></asp:ListItem>
                                                    <asp:ListItem Value="2016" Text="2016"></asp:ListItem>
                                                    <asp:ListItem Value="2017" Text="2017"></asp:ListItem>
                                                    <asp:ListItem Value="2018" Text="2018"></asp:ListItem>
                                                    <asp:ListItem Value="2019" Text="2019"></asp:ListItem>
                                                    <asp:ListItem Value="2020" Text="2020"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td class="BackGround-gray">
                                                Region:
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="dropRegion" runat="server" CssClass="chzn-select">
                                                    <asp:ListItem Value="00" Text="All"></asp:ListItem>
                                                    <asp:ListItem Value="01" Text="NORTH"></asp:ListItem>
                                                    <asp:ListItem Value="02" Text="MIDDLE"></asp:ListItem>
                                                    <asp:ListItem Value="03" Text="SOUTH"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td style="border-right: none!important; padding-right: 0px;">
                                                <asp:DropDownList ID="dropbillShop" ClientIDMode="Static" runat="server" CssClass="chzn-select"
                                                    Width="80px">
                                                    <asp:ListItem Value="bill" Text="Bill Name"></asp:ListItem>
                                                    <asp:ListItem Value="shop" Text="Shop Name"></asp:ListItem>
                                                </asp:DropDownList>
                                            </td>
                                            <td style="border-left: none!important; padding-left: 0px;">
                                                <asp:TextBox ID='txtBill' ClientIDMode="Static" runat="server"></asp:TextBox>
                                                <asp:TextBox ID='txtShopName' ClientIDMode="Static" runat="server" Style="display: none;"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:Button ID="btnSearch" runat="server" Text="Search" Width="80px" OnClick="btnSearch_Click"
                                                    CssClass="button" />
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                                <!-- DataGrid End -->
                            </div>
                        </div>
                        <div class="Clear_both">
                        </div>
                    </div>
                    <div class="TitleCont">
                        Information Detail
                        <asp:Button ID="btnExcel" runat="server" OnClick="btnExcel_Click" Width="80px" CssClass="button Float-right"
                            Text="Export" />
                    </div>
                    <div style="overflow: auto;">
                        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0"
                            AutoGenerateColumns="false" OnColumnCreated="RadGrid1_ColumnCreated" CssClass="RadGridCustomClass"
                            GridLines="None" ShowGroupPanel="True" OnNeedDataSource="RadGrid1_NeedDataSource"
                            BorderWidth="1" OnGroupsChanging="RadGrid1_GroupsChanging" Skin="Office2007"
                            OnItemDataBound="RadGrid1_ItemDataBound" onprerender="RadGrid1_PreRender">
                            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">
                            </ClientSettings>
                            <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true" TableLayout='Auto'>
                                <PagerStyle AlwaysVisible="True" />
                                <Columns>
                                    <telerik:GridBoundColumn DataField="REGION" HeaderText="REGION">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="PROVINCE" HeaderText="PROVINCE">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="CUST_NAME" HeaderText="CUST_NAME">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ADDRESS" HeaderText="ADDRESS">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BILLTO" HeaderText="BILLTO">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BILL_NAME" HeaderText="BILL_NAME">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="PRODUCT" HeaderText="PRODUCT">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="MODEL" HeaderText="MODEL">
                                    </telerik:GridBoundColumn>     
                                    <telerik:GridBoundColumn DataField="QTY"  HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:#,0}"  HeaderText="QTY">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="WT_AMT"  HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:#,0}"  HeaderText="WT_AMT">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="INCT_AMT" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:#,0}"  HeaderText="INCT_AMT">
                                    </telerik:GridBoundColumn>                                  
                                    <telerik:GridBoundColumn DataField="SCHEME" HeaderText="SCHEME">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="CUST_NAME"></telerik:GridGroupByField>
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="CUST_NAME" HeaderText="CUST_NAME"></telerik:GridGroupByField>
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                            </MasterTableView>
                            <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
                        </telerik:RadGrid>

                        <telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="True" CellSpacing="0"
                            AutoGenerateColumns="false" OnColumnCreated="RadGrid1_ColumnCreated" CssClass="RadGridCustomClass"
                            GridLines="None" ShowGroupPanel="True" OnNeedDataSource="RadGrid1_NeedDataSource"
                            BorderWidth="1" OnGroupsChanging="RadGrid1_GroupsChanging" Skin="Office2007"
                            OnItemDataBound="RadGrid1_ItemDataBound" onprerender="RadGrid1_PreRender">
                            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">
                            </ClientSettings>
                            <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true" TableLayout='Auto'>
                                <PagerStyle AlwaysVisible="True" />
                                <Columns>
                                    <telerik:GridBoundColumn DataField="REGION" HeaderText="REGION">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="PROVINCE" HeaderText="PROVINCE">
                                    </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="BELONG_TO_BILL" HeaderText="BELONG_TO_BILL">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BELONG_TO_CUSTOMER" HeaderText="BELONG_TO_CUSTOMER">
                                    </telerik:GridBoundColumn> 
                                    <telerik:GridBoundColumn DataField="CUST_NAME" HeaderText="CUST_NAME">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ADDRESS" HeaderText="ADDRESS">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="PRODUCT" HeaderText="PRODUCT">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="MODEL" HeaderText="MODEL">
                                    </telerik:GridBoundColumn>     
                                    <telerik:GridBoundColumn DataField="QTY"  HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:#,0}"  HeaderText="QTY">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="WT_AMT"  HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:#,0}"  HeaderText="WT_AMT">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="INCT_AMT" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"
                                        DataFormatString="{0:#,0}"  HeaderText="INCT_AMT">
                                    </telerik:GridBoundColumn>                                  
                                    <telerik:GridBoundColumn DataField="SCHEME" HeaderText="SCHEME_NAME">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="CUST_NAME"></telerik:GridGroupByField>
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="CUST_NAME" HeaderText="CUST_NAME"></telerik:GridGroupByField>
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                            </MasterTableView>
                            <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
                        </telerik:RadGrid>
                    </div>
                </div>
            </div>
            <div class="Clear_both">
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(".chzn-select").chosen();
    </script>
    </form>
</body>
</html>
